package com.example.reggie.controller;

import com.example.reggie.utils.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExceptionController {
    @ExceptionHandler({Exception.class})
    public R<String> handler(Exception exception){
        return R.error(exception.getMessage());
    }
}
